<?php $this->load->view('headerfooter/header'); ?>
	<link rel="stylesheet" href="<?=base_url()?>/src/css/jqueryui.css">
	<script src="<?=base_url()?>/src/js/jqueryui-1.10.4.min.js"></script>
	<script>
		$(function() {
		  $("#datepicker").datepicker();
		  $("#datepicker1").datepicker();
		$("#datepicker").datepicker("option","dateFormat","yy-mm-dd");
		$("#datepicker1").datepicker("option","dateFormat","yy-mm-dd");
		});
	</script>
			<script>
	    var getData;
		
		function setRequest(){
			if (window.XMLHttpRequest){
				return new XMLHttpRequest();
			}
			if (window.ActiveXObject){
				return new ActiveXObject("Microsoft.XMLHTTP");
			}
			return null;
		}
		function showDinas(cat_id){
			getData = setRequest();
			var url= "<?=site_url()?>/pencarian/get_kategori/"+cat_id;
			getData.open("GET",url,true);
			getData.onreadystatechange=stateChangedDinas;
			getData.send(null);
		}	
		function stateChangedDinas(){
			var data='';
			var insert;
			if (getData.readyState==4){
				insert= JSON.parse(getData.responseText);
				data += '<option value="-1">Pilih</option>';
				$.each (insert.kategori, function (index, eachdata){
					data += '<option value="'+eachdata.id+'">'+eachdata.nama+'</option>';
				});
				console.log("dataparsing:"+data);
				document.getElementById("dinas").innerHTML = data;
				$("#kategori").val('-1');
			}
		}
		function showKategori(cat_id){
			getData = setRequest();
			var url= "<?=site_url()?>/pencarian/get_kategori/"+cat_id;
			getData.open("GET",url,true);
			getData.onreadystatechange= stateChangedKategori;
			getData.send(null);
		}	
		function stateChangedKategori(){
			var data='';
			var insert;
			if (getData.readyState==4){
				insert= JSON.parse(getData.responseText);
				data += '<option value="-1">Pilih</option>';
				$.each (insert.kategori, function (index, eachdata){
					data += '<option value="'+eachdata.id+'">'+eachdata.nama+'</option>';
				});
				console.log("dataparsing:"+data);
				document.getElementById("kategori").innerHTML = data;
			}
		} 
	</script>
            <div class="container">
                <div class="col-sm-4 col-sm-offset-1">
                    <div class="panel panel-success">
                        <div class="panel-heading">
                            <div class="panel-title" style="text-align:center"><?=$title?></div>
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <?= form_open_multipart('pencarian/search'); ?>
								<!-- h3 class="text-center"><strong>Kategori</strong></h3>
								<div class="form-group form-inline form-insert-kategori">
									<select id="area" class="combobox" onchange="showDinas(this.value)">
										<option value="-1">Pilih</option>
										<?php foreach($kategori_parent as $data_kategori):?>
											<option value="<?=$data_kategori['id']?>"><?=$data_kategori['nama']?></option>
										<?php endforeach; ?>
									</select> -
									<select id="dinas" class="combobox" onchange="showKategori(this.value)">
										<option value="-1">Pilih</option>
									</select> -
									<select name="kategori" class="combobox" id="kategori">
										<option value="-1">Pilih</option>
									</select>
								</div -->
								<div class="form-group">
                                    <label for="KodeSurat" class="col-sm-2 control-label">Kode Surat</label>
                                    <div class="col-sm-10">
                                        <input name="kode-surat" class="form-control" type="text" placeholder="Kode Surat"/><br>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="Instansi" class="col-sm-2 control-label">Nama Instansi</label>
                                    <div class="col-sm-10">
                                        <input name="nama-instansi" class="form-control" type="text" placeholder="Nama Instansi"/><br>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="TglKerjasama" class="col-sm-2 control-label">Tanggal Kerjasama</label>
                                    <div class="col-sm-10">
                                        <input id ="datepicker" name="tanggal-kerjasama" class="form-control" type="text" placeholder="Tanggal Kerjasama" /><br>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="TanggalKadaluarsa" class="col-sm-2 control-label">Tanggal Kadaluarsa</label>
                                    <div class="col-sm-10">
                                        <input id ="datepicker1" name="masa-berlaku" class="form-control" type="text" placeholder="Masa Berlaku" /><br>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="Kerjasama" class="col-sm-2 control-label">Kerjasama</label>
                                    <div class="col-sm-10">
                                        <input name="kerjasama" class="form-control" type="text" placeholder="Kerjasama" /><br>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="KodeSurat" class="col-sm-2 control-label">Nomer Surat</label>
                                    <div class="col-sm-10">
                                        <input name="nomer-surat" class="form-control" type="text" placeholder="Nomer Surat" /><br>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="Deskripsi" class="col-sm-2 control-label">Deskripsi</label>
                                    <div class="col-sm-10">
                                        <textarea name="deskripsi" class="form-control" type="text" placeholder="Deskripsi"></textarea><br>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="UnitTerkait" class="col-sm-2 control-label">Unit Terkait</label>
                                    <div class="col-sm-10">
                                        <input name="unit-terkait" class="form-control" type="text" placeholder="Unit Terkait"/><br>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="Implementasi" class="col-sm-2 control-label">Implementasi</label>
                                    <div class="col-sm-10">
                                        <input name="implementasi" type="text" class="form-control" placeholder="Implementasi"/><br>
                                    </div>
                                </div>
								
                            </div>
                            <button type="submit" class="btn btn-lg btn-success btn-block"/><i class="fa fa-search"></i> Cari Surat</button>
                            <?= form_close() ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>

<<<<<<< .mine

=======
		<script>
	    var getData;
		
		function setRequest(){
			if (window.XMLHttpRequest){
				return new XMLHttpRequest();
			}
			if (window.ActiveXObject){
				return new ActiveXObject("Microsoft.XMLHTTP");
			}
			return null;
		}
		function showDinas(cat_id){
			getData = setRequest();
			var url= "<?=site_url()?>/surat/get_kategori/"+cat_id;
			getData.open("GET",url,true);
			getData.onreadystatechange=stateChangedDinas;
			getData.send(null);
		}	
		function stateChangedDinas(){
			var data='';
			var insert;
			if (getData.readyState==4){
				insert= JSON.parse(getData.responseText);
				data += '<option value="-1">Pilih</option>';
				$.each (insert.kategori, function (index, eachdata){
					data += '<option value="'+eachdata.id+'">'+eachdata.nama+'</option>';
				});
				console.log("dataparsing:"+data);
				document.getElementById("dinas").innerHTML = data;
				$("#kategori").val('-1');
			}
		}
		function showKategori(cat_id){
			getData = setRequest();
			var url= "<?=site_url()?>/surat/get_kategori/"+cat_id;
			getData.open("GET",url,true);
			getData.onreadystatechange= stateChangedKategori;
			getData.send(null);
		}	
		function stateChangedKategori(){
			var data='';
			var insert;
			if (getData.readyState==4){
				insert= JSON.parse(getData.responseText);
				data += '<option value="-1">Pilih</option>';
				$.each (insert.kategori, function (index, eachdata){
					data += '<option value="'+eachdata.id+'">'+eachdata.nama+'</option>';
				});
				console.log("dataparsing:"+data);
				document.getElementById("kategori").innerHTML = data;
			}
		} 
	</script>
>>>>>>> .r95
 <?php $this->load->view('headerfooter/footer'); ?>
